var up; 
up = keyboard_check(ord("W"));

var down; 
down = keyboard_check(ord("S"));

var left;
left = keyboard_check(ord("A"));
{
var right;
right = keyboard_check(ord("D"));



switch (keyboard_key)
	{
		case vk_left:
		case ord("A"):
		if(left)then{
		image_speed = 1;
		x -= 4;
		image_angle = -90;
		}
		else
		{
		image_speed = 0;
		}
		break;
		
		case vk_right:
		case ord("D"):
		if(right)then{
		image_speed = 1;
		x +=4
		image_angle = 90;
		}
		else
		{
		image_speed = 0;
		}
		break;
		
		
		case vk_up:
		case ord("W"):
		if(up)then{
		image_speed = 1;
		y -= 4;
		image_angle = 180;
		}
		else
		{
		image_speed = 0;
		}
		break;
	
		case vk_down:
		case ord("S"):
		if(down)then{
		image_speed = 1;
		y += 4;
		image_angle = 360;
		}
		else
		{
		image_speed = 0;
		}
		break;
	}
}
